<template>
  <div>
    <div id="pp">{{ msg }}</div>
    <button @click="msg = 'hello'">点击修改</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      msg: "你好世界",
    };
  },
  beforeCreate() {
    console.log("beforeCreate", this.msg);
  },
  created() {
    console.log("created", this.msg);
  },
  beforeMount() {
    const pp = document.querySelector("#pp");
    console.log("beforeMount", pp);
  },
  mounted() {
    const pp = document.querySelector("#pp");
    console.log("mounted", pp);
  },
  beforeUpdate() {
    const pp = document.querySelector("#pp");
    console.log("beforeUpdate", pp.innerHTML);
  },
  updated() {
    const pp = document.querySelector("#pp");
    console.log("updated", pp.innerHTML);
  },
  beforeDestroy() {
    console.log("beforeDestroy");
  },
  destroyed() {
    console.log("destroyed");
  },
};
</script>

<style scoped>
</style>